﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace W5_DoAnCuoiKy_Glow
{
    public class CurrentContext //Kiểm tra Cookie tài khoản
    {
        public static bool IsLogged
        {
            get
            {
                return HttpContext.Current.Request.Cookies["UserDangNhap"] != null;
            }
        }

        public static string UserName
        {
            get
            {
                return HttpContext.Current.Request.Cookies["UserDangNhap"].Value;
            }
        }

        public static USER User
        {
            get { return HttpContext.Current.Session["UserDangNhap"] as USER; }
            set { HttpContext.Current.Session["UserDangNhap"] = value; }
        }
    }
}
